package com.lupan.mutithred.cp9_ForkJoin;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;

/**
 * 说明：
 *
 * @author lupan
 * @version 2017/5/25 10:36
 */
public class Main {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        long startTime = System.currentTimeMillis();
        System.out.println("开始时间："+startTime);

        ForkJoinPool pool = new ForkJoinPool();
        MyRecursiveTask task = new MyRecursiveTask(1,10000);
        pool.submit(task);
        System.out.println("结果为："+task.get());

        long endTime = System.currentTimeMillis();
        System.out.println("结束时间："+endTime);
        System.out.println("用时："+(endTime-startTime));
    }
}
